Skip to content

Conversation

dlhandsome
Copy link

@dlhandsome dlhandsome commented May 27, 2020

The result would be the same if data is not a string when we want to get a hashcode.

For example:

const Crypto = require('crypto-js');

console.log(Crypto.MD5(1).toString()) // 487f7b22f68312d2c1bbc93b1aea445b
console.log(Crypto.MD5(2).toString()) // 487f7b22f68312d2c1bbc93b1aea445b
console.log(Crypto.MD5(3).toString()) // 487f7b22f68312d2c1bbc93b1aea445b
console.log(Crypto.MD5([32, 0, 0, 0]).toString()) // 487f7b22f68312d2c1bbc93b1aea445b

So, we should throw type error under these circumstances.

@dlhandsome
Copy link
Author

#203

@Alanscut
Copy link
Contributor

Alanscut commented Jun 9, 2020

Looks Good 👍

@majorhayes
Copy link

Wouldn't this mean that you can't pass a WordArray object in anymore? Why would you want to remove that feature?

@evanvosberg
Copy link
Member

Wouldn't this mean that you can't pass a WordArray object in anymore? Why would you want to remove that feature?

Adding type check is fine, but this should not remove the possibility to use WordArray beside String.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants